#pragma once

#include "MyTestTypes.h"
#include "testdosestatcuda_export.h"

namespace dosestatcuda
{
    using mytesttypes::DoseStatRet;

    // 计算DVH（剂量体积直方图）
    TESTDOSESTATCUDA_EXPORT DoseStatRet Accumulate(const std::vector<double>& voxelVolume,
                                                   const std::vector<double>& voxelDose,
                                                   bool doExactAccumulation);

    // 计算ROI内的剂量统计指标
    TESTDOSESTATCUDA_EXPORT double GetDoseStatRoiInterp(const std::string& dose_type,
                                                        const std::vector<double>& binnedDoseValues,
                                                        const std::vector<double>& accumulatedRelativeVolumes,
                                                        const std::vector<double>& voxelVolume,
                                                        const std::vector<double>& voxelDose,
                                                        double doseAtVolume = 0.0);

    // 辅助函数：获取特定体积百分比对应的剂量
    TESTDOSESTATCUDA_EXPORT double GetMetric(double doseAtVolume,
                                             const std::vector<double>& binnedDoseValues,
                                             const std::vector<double>& accumulatedRelativeVolumes);

}  // namespace dosestatcuda